<?php
/**
 * @name Base.php
 * @desc sample数据获取类, 可以访问数据库，文件，其它系统等
 * @author tracy
 */

class Db_Base
{
    public static $errno  = 0;
    public static $errmsg = '';
    public static $db     = null;

    public static function getDbInstance()
    {
        if (self::$db == null) {
            self::$db = new PDO(conf\DbConf::DB_DSN, conf\DbConf::DB_USER, conf\DbConf::DB_PWD);
        }
        return self::$db;
    }

    public function errno()
    {
        return self::$errno;
    }

    public function errmsg()
    {
        return self::$errmsg;
    }

}
